package com.project.mapper;

import com.project.bean.BookBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface IBookMapper {
    @Select("select * from t_book")
    @ResultMap("bookMap")
    public List<BookBean> findAll();

    /***
     * 按id查询书籍
     * @param id 书籍id
     * @return 书籍对象
     */
    @Select("select * from t_book where pk_bookId=#{id}")
    @ResultMap("bookMap")
    public BookBean findById(int id);
}
